home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Bowers Development / Demo AppMaker / Examples / plain C OS8 / Everything / DModalTextData.c < prev    next >
Encoding:
Text File  |  1998-10-29  |  3.7 KB  |  227 lines  |  [TEXT/CWIE]

  1. // DModalTextData.cp -- data container class for Everything
  2.  
  3. #include "PString.h"
  4. #include "DModalTextData.h"
  5.  
  6. #include <stdlib.h>
  7.  
  8. //----------
  9. DModalTextData*        NewDModalTextData ()
  10. {
  11.     DModalTextData*        data;
  12.  
  13.     data = (DModalTextData*)malloc (sizeof (DModalTextData));
  14.     DModalTextData_Init (data);
  15.  
  16.     return data;
  17. }
  18.  
  19. //----------
  20. void    DeleteDModalTextData (
  21.     DModalTextData*        data)
  22. {
  23.     DModalTextData_Free (data);
  24.     free (data);
  25. }
  26.  
  27. //----------
  28. void    DModalTextData_Init (
  29.     DModalTextData*        self)
  30. {
  31.     AMSignaler_Init ((AMSignaler*) self);
  32.  
  33.     AssignPStr (self->mSmall2, "\psmall");
  34.     AssignPStr (self->mLarge2, "\plarge");
  35.     self->mX12346 = 0;
  36.     self->mX12345e7 = 0.0;
  37.     AssignPStr (self->mPassword2, "\ppassword");
  38.     self->mDate2.od.eraAlt = 0;
  39.     GetTime (&self->mDate2.od.oldDate);
  40.     self->mTime2.od.eraAlt = 0;
  41.     GetTime (&self->mTime2.od.oldDate);
  42.     AssignPStr (self->mStyled2, "\pstyled");
  43. }
  44.  
  45. //----------
  46. void    DModalTextData_Free (
  47.     DModalTextData*        self)
  48. {
  49.     AMSignaler_Free ((AMSignaler*) self);
  50. }
  51.  
  52. //----------
  53. StringPtr    GetSmall2 (
  54.     DModalTextData*        self)
  55. {
  56.  
  57.     AssignPStr (nil, self->mSmall2);
  58.     return self->mSmall2;
  59. }
  60.  
  61. void    SetSmall2Str (
  62.     DModalTextData*        self,
  63.     Str255        inValue)
  64. {
  65.     AssignPStr (self->mSmall2, inValue);
  66.     
  67.     SignalDataChanged ((AMSignaler*) self, idSmall2);
  68. }
  69.  
  70. void    SetSmall2Handle (
  71.     DModalTextData*        self,
  72.     CharsHandle        inValue)
  73. {
  74.     AssignPStrHandle (self->mSmall2, inValue);
  75.     
  76.     SignalDataChanged ((AMSignaler*) self, idSmall2);
  77. }
  78.  
  79. //----------
  80. StringPtr    GetLarge2 (
  81.     DModalTextData*        self)
  82. {
  83.  
  84.     AssignPStr (nil, self->mLarge2);
  85.     return self->mLarge2;
  86. }
  87.  
  88. void    SetLarge2Str (
  89.     DModalTextData*        self,
  90.     Str255        inValue)
  91. {
  92.     AssignPStr (self->mLarge2, inValue);
  93.     
  94.     SignalDataChanged ((AMSignaler*) self, idLarge2);
  95. }
  96.  
  97. void    SetLarge2Handle (
  98.     DModalTextData*        self,
  99.     CharsHandle        inValue)
  100. {
  101.     AssignPStrHandle (self->mLarge2, inValue);
  102.     
  103.     SignalDataChanged ((AMSignaler*) self, idLarge2);
  104. }
  105.  
  106. //----------
  107. SInt32        GetX12346 (
  108.     DModalTextData*        self)
  109. {
  110.  
  111.     return self->mX12346;
  112. }
  113.  
  114. void    SetX12346 (
  115.     DModalTextData*        self,
  116.     SInt32        inValue)
  117. {
  118.     self->mX12346 = inValue;
  119.     
  120.     SignalDataChanged ((AMSignaler*) self, idX12346);
  121. }
  122.  
  123. //----------
  124. double        GetX12345e7 (
  125.     DModalTextData*        self)
  126. {
  127.  
  128.     return self->mX12345e7;
  129. }
  130.  
  131. void    SetX12345e7 (
  132.     DModalTextData*        self,
  133.     double        inValue)
  134. {
  135.     self->mX12345e7 = inValue;
  136.     
  137.     SignalDataChanged ((AMSignaler*) self, idX12345e7);
  138. }
  139.  
  140. //----------
  141. StringPtr    GetPassword2 (
  142.     DModalTextData*        self)
  143. {
  144.  
  145.     AssignPStr (nil, self->mPassword2);
  146.     return self->mPassword2;
  147. }
  148.  
  149. void    SetPassword2Str (
  150.     DModalTextData*        self,
  151.     Str255        inValue)
  152. {
  153.     AssignPStr (self->mPassword2, inValue);
  154.     
  155.     SignalDataChanged ((AMSignaler*) self, idPassword2);
  156. }
  157.  
  158. void    SetPassword2Handle (
  159.     DModalTextData*        self,
  160.     CharsHandle        inValue)
  161. {
  162.     AssignPStrHandle (self->mPassword2, inValue);
  163.     
  164.     SignalDataChanged ((AMSignaler*) self, idPassword2);
  165. }
  166.  
  167. //----------
  168. LongDateRec        GetDate2 (
  169.     DModalTextData*        self)
  170. {
  171.  
  172.     return self->mDate2;
  173. }
  174.  
  175. void    SetDate2 (
  176.     DModalTextData*        self,
  177.     LongDateRec        inValue)
  178. {
  179.     self->mDate2 = inValue;
  180.     
  181.     SignalDataChanged ((AMSignaler*) self, idDate2);
  182. }
  183.  
  184. //----------
  185. LongDateRec        GetTime2 (
  186.     DModalTextData*        self)
  187. {
  188.  
  189.     return self->mTime2;
  190. }
  191.  
  192. void    SetTime2 (
  193.     DModalTextData*        self,
  194.     LongDateRec        inValue)
  195. {
  196.     self->mTime2 = inValue;
  197.     
  198.     SignalDataChanged ((AMSignaler*) self, idTime2);
  199. }
  200.  
  201. //----------
  202. StringPtr    GetStyled2 (
  203.     DModalTextData*        self)
  204. {
  205.  
  206.     AssignPStr (nil, self->mStyled2);
  207.     return self->mStyled2;
  208. }
  209.  
  210. void    SetStyled2Str (
  211.     DModalTextData*        self,
  212.     Str255        inValue)
  213. {
  214.     AssignPStr (self->mStyled2, inValue);
  215.     
  216.     SignalDataChanged ((AMSignaler*) self, idStyled2);
  217. }
  218.  
  219. void    SetStyled2Handle (
  220.     DModalTextData*        self,
  221.     CharsHandle        inValue)
  222. {
  223.     AssignPStrHandle (self->mStyled2, inValue);
  224.     
  225.     SignalDataChanged ((AMSignaler*) self, idStyled2);
  226. }
  227.